package org.example.doubleFinger;

public class Replace_spaces {
    public static void main(String[] args) {
        //路径加密

        //假定一段路径记作字符串 path，其中以 "." 作为分隔符。现需将路径加密，加密方法为将 path 中的分隔符替换为空格 " "，请返回加密后的字符串。
        String path = "a.aef.qerf.bb";
        System.out.println(pathEncryption(path));
    }
    public static String pathEncryption(String path) {
        StringBuilder sb = new StringBuilder(path);
        for (int i = 0; i < sb.length(); i++) {
            if (sb.charAt(i)=='.'){
                sb.setCharAt(i,' ');
            }
        }
        return sb.toString();
    }
}
